package com.web.kdl.config.security.components;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * @Author： shulibin
 * @Date： 2025/7/28 13:58
 * @Describe：
 */
@Getter
public class AuthUser extends User {
    private final String userId;
    private final String username;
    private final String email;
    private final String role;

    public AuthUser(String userId, String username, String password,String email,String  role, Collection<GrantedAuthority> authorities) {
        super(userId, password, authorities); // 父类用userId作为principal
        this.userId = userId;
        this.username = username;
        this.email =email;
        this.role = role;
    }
}
